package com.sanchunhui.psc.utils.bleuitls.callback

import android.bluetooth.BluetoothAdapter
import android.bluetooth.BluetoothDevice

/**
 * 扫描成功的回调
 */
class BleDevceScanCallback() : BluetoothAdapter.LeScanCallback {

    private var mScanCallback : ScanCallback? = null
    fun BleDevceScanCallback(scanCallback : ScanCallback)  {
        mScanCallback = scanCallback
    }
    override fun onLeScan(device: BluetoothDevice, rssi: Int, scanRecord: ByteArray) {
        if (null != mScanCallback) {
            //每次扫描到设备会回调此方法,这里一般做些过滤在添加进list列表
            mScanCallback!!.onScanning(device, rssi, scanRecord)
        }
    }
}
